package com.bright.hxj.cwduijie.pojo.dto;

import lombok.Data;

import java.util.List;

/**
 * @Author Tz
 * @Date 2023/11/29 14:41
 * @Description
 */
@Data
public class PageDTO<T> {

    private static final long serialVersionUID = 1L;

    /**
     * 总数
     */
    private Long total;

    /**
     * 总页数
     */
    private Integer pageCount;

    /**
     * 数据
     */
    private List<T> data;


    private PageDTO(Long total, Integer pageCount, List<T> data) {
        this.total = total;
        this.pageCount = pageCount;
        this.data = data;
    }

    public static <T> PageDTO of(Long total, Integer pageCount, List<T> data){
        return new PageDTO(total, pageCount, data);
    }

}
